#wget https://dl.winqi.cn/hc/hcAutoInstall.tar


if [ -z $1 ]; then 
   echo 'using  sh ./build.sh dev'
   exit 1
fi

cd /home/zhangyh/gjs-workspace/gjs/freeter-coding
git pull 
if [ $? -ne 0 ]; then
    echo "code download fail" 
	exit
fi
mvn clean package -D maven.test.skip=true
if [ $? -ne 0 ]; then
    echo "complier fail"
    exit	
fi

cd /home/zhangyh/gjs-workspace/gjs/freeter-coding/gjs-api/docker
sh ./onStart.sh $1

if [ $? -ne 0 ]; then
    echo "api docker build fail"
    exit	
fi

sleep 50
echo 'api start'
  
cd /home/zhangyh/gjs-workspace/gjs/freeter-coding/gjs-admin/docker
sh ./onStart.sh $1
echo "run is ok"

